<!DOCTYPE html>
<html>

<head>
  <title>Quarkus - Building a Native Executable</title>
  <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script>
  <script src="/assets/javascript/highlight.pack.js" type="text/javascript"></script>
  <META HTTP-EQUIV='Content-Security-Policy' CONTENT="default-src 'none'; script-src 'self' 'unsafe-eval' 'sha256-ANpuoVzuSex6VhqpYgsG25OHWVA1I+F6aGU04LoI+5s=' 'sha256-ipy9P/3rZZW06mTLAR0EnXvxSNcnfSDPLDuh3kzbB1w=' js.bizographics.com https://www.redhat.com assets.adobedtm.com jsonip.com https://ajax.googleapis.com https://www.googletagmanager.com https://www.google-analytics.com https://use.fontawesome.com; style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; img-src 'self' *; media-src 'self' ; frame-src https://www.googletagmanager.com https://www.youtube.com; frame-ancestors 'none'; base-uri 'none'; object-src 'none'; form-action 'none'; font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;">
  <META HTTP-EQUIV='X-Frame-Options' CONTENT="DENY">
  <META HTTP-EQUIV='X-XSS-Protection' CONTENT="1; mode=block">
  <META HTTP-EQUIV='X-Content-Type-Options' CONTENT="nosniff">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Quarkus: Supersonic Subatomic Java">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@QuarkusIO"> 
  <meta name="twitter:creator" content="@QuarkusIO">
  <meta property="og:url" content="https://quarkus.io/guides/building-native-image" />
  <meta property="og:title" content="Quarkus - Building a Native Executable" />
  <meta property="og:description" content="Quarkus: Supersonic Subatomic Java" />
  <meta property="og:image" content="/assets/images/quarkus_card.png" />
  <link rel="canonical" href="https://quarkus.io/guides/building-native-image">
  <link rel="shortcut icon" type="image/png" href="/favicon.ico" >
  <link rel="stylesheet" href="https://quarkus.io/guides/stylesheet/config.css" />
  <link rel="stylesheet" href="/assets/css/main.css" />
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="alternate" type="application/rss+xml"  href="https://quarkus.io/feed.xml" title="Quarkus">
  <script src="https://quarkus.io/assets/javascript/goan.js" type="text/javascript"></script>
  <script src="https://quarkus.io/assets/javascript/hl.js" type="text/javascript"></script>
</head>

<body class="guides">
  <!-- Google Tag Manager (noscript) -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJWS5L"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <!-- End Google Tag Manager (noscript) -->

  <div class="nav-wrapper">
  <div class="grid-wrapper">
    <div class="width-12-12">
      <input type="checkbox" id="checkbox" />
      <nav id="main-nav" class="main-nav">
  <div class="container">
    <div class="logo-wrapper">
      
        <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png" class="project-logo" title="Quarkus"></a>
      
    </div>
    <label class="nav-toggle" for="checkbox">
      <i class="fa fa-bars"></i>
    </label>
    <div id="menu" class="menu">
      <span>
        <a href="/get-started/" class="">Get Started</a>
      </span>
      <span>
        <a href="/guides/" class="active">Guides</a>
      </span>
      <span>
        <a href="/community/" class="">Community</a>
      </span>
      <span>
        <a href="/support/" class="">Support</a>
      </span>
      <span>
        <a href="/blog/" class="">Blog</a>
      </span>
      <span>
        <a href="https://code.quarkus.io" class="button-cta secondary white">Start Coding</a>
      </span>
    </div>
  </div>
      </nav>
    </div>
  </div>
</div>

  <div class="content">
    <div class="guide">
  <div class="width-12-12">
    <h1 class="text-caps">Quarkus - Building a Native Executable</h1>
    <div class="hide-mobile toc"><ul class="sectlevel1">
<li><a href="#prerequisites">Prerequisites</a>
<ul class="sectlevel2">
<li><a href="#configuring-graalvm">Configuring GraalVM</a></li>
</ul>
</li>
<li><a href="#solution">Solution</a></li>
<li><a href="#producing-a-native-executable">Producing a native executable</a></li>
<li><a href="#testing-the-native-executable">Testing the native executable</a>
<ul class="sectlevel2">
<li><a href="#excluding-tests-when-running-as-a-native-executable">Excluding tests when running as a native executable</a></li>
<li><a href="#testing-an-existing-native-executable">Testing an existing native executable</a></li>
</ul>
</li>
<li><a href="#container-runtime">Creating a Linux executable without GraalVM installed</a></li>
<li><a href="#creating-a-container">Creating a container</a>
<ul class="sectlevel2">
<li><a href="#using-the-container-image-extensions">Using the container-image extensions</a></li>
<li><a href="#manually">Manually</a></li>
<li><a href="#using-a-multi-stage-docker-build">Using a multi-stage Docker build</a></li>
</ul>
</li>
<li><a href="#configuration-reference">Configuring the Native Executable</a></li>
<li><a href="#whats-next">What&#8217;s next?</a></li>
</ul></div>
    <div>
      <div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This guide covers:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Compiling the application to a native executable</p>
</li>
<li>
<p>Packaging the native executable in a container</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This guide takes as input the application developed in the <a href="getting-started">Getting Started Guide</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="prerequisites"><a class="anchor" href="#prerequisites"></a>Prerequisites</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To complete this guide, you need:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>less than 15 minutes</p>
</li>
<li>
<p>an IDE</p>
</li>
<li>
<p>JDK 8 installed with <code>JAVA_HOME</code> configured appropriately</p>
</li>
<li>
<p>A <a href="#configuring-c-development">working C development environment</a></p>
</li>
<li>
<p>GraalVM version 20.1.0 installed and <a href="#configuring-graalvm">configured appropriately</a></p>
</li>
<li>
<p>A working container runtime (Docker, podman)</p>
</li>
<li>
<p>The code of the application developed in the <a href="getting-started">Getting Started Guide</a>.</p>
</li>
</ul>
</div>
<div id="configuring-c-development" class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="title">Supporting native compilation in C</div>
<div class="paragraph">
<p>What does having a working C developer environment mean?</p>
</div>
<div class="ulist">
<ul>
<li>
<p>On Linux, you will need GCC, and the glibc and zlib headers. Examples for common distributions:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs"># dnf (rpm-based)
sudo dnf install gcc glibc-devel zlib-devel libstdc++-static
# Debian-based distributions:
sudo apt-get install build-essential libz-dev zlib1g-dev</code></pre>
</div>
</div>
</li>
<li>
<p>XCode provides the required dependencies on macOS:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">xcode-select --install</code></pre>
</div>
</div>
</li>
<li>
<p>On Windows, you will need to install the <a href="https://aka.ms/vs/15/release/vs_buildtools.exe">Visual Studio 2017 Visual C++ Build Tools</a></p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="configuring-graalvm"><a class="anchor" href="#configuring-graalvm"></a>Configuring GraalVM</h3>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>If you cannot install GraalVM, you can use a multi-stage Docker build to run Maven inside a Docker container that embeds GraalVM. There is an explanation of how to do this at the end of this guide.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Version 20.1.0 is required. Using the community edition is enough.</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Install GraalVM if you haven&#8217;t already. You have a few options for this:</p>
<div class="ulist">
<ul>
<li>
<p>Use platform-specific install tools like <a href="https://github.com/graalvm/homebrew-tap">homebrew</a>, <a href="https://sdkman.io/jdks#Oracle">sdkman</a>, or <a href="https://github.com/ScoopInstaller/Java">scoop</a>.</p>
</li>
<li>
<p>Download the appropriate Community Edition archive from <a href="https://github.com/graalvm/graalvm-ce-builds/releases" class="bare">https://github.com/graalvm/graalvm-ce-builds/releases</a>, and unpack it like you would any other JDK.</p>
</li>
</ul>
</div>
</li>
<li>
<p>Configure the runtime environment. Set <code>GRAALVM_HOME</code> environment variable to the GraalVM installation directory, for example:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">export GRAALVM_HOME=$HOME/Development/graalvm/</code></pre>
</div>
</div>
<div class="paragraph">
<p>On macOS, point the variable to the <code>Home</code> sub-directory:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">export GRAALVM_HOME=$HOME/Development/graalvm/Contents/Home/</code></pre>
</div>
</div>
<div class="paragraph">
<p>On Windows, you will have to go through the Control Panel to set your environment variables.</p>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>Installing via scoop will do this for you.</p>
</div>
</td>
</tr>
</table>
</div>
</li>
<li>
<p>Install the <code>native-image</code> tool using <code>gu install</code>:</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">${GRAALVM_HOME}/bin/gu install native-image</code></pre>
</div>
</div>
<div class="paragraph">
<p>Some previous releases of GraalVM included the <code>native-image</code> tool by default.  This is no longer the case; it must be installed as a second step after GraalVM itself is installed. Note: there is an outstanding issue <a href="#graal-and-catalina">using GraalVM with macOS Catalina</a>.</p>
</div>
</li>
<li>
<p>(Optional) Set the <code>JAVA_HOME</code> environment variable to the GraalVM installation directory.</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">export JAVA_HOME=${GRAALVM_HOME}</code></pre>
</div>
</div>
</li>
<li>
<p>(Optional) Add the GraalVM <code>bin</code> directory to the path</p>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">export PATH=${GRAALVM_HOME}/bin:$PATH</code></pre>
</div>
</div>
</li>
</ol>
</div>
<div id="graal-and-catalina" class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="title">Issues using GraalVM with macOS Catalina</div>
<div class="paragraph">
<p>GraalVM binaries are not (yet) notarized for macOS Catalina as reported in this <a href="https://github.com/oracle/graal/issues/1724">GraalVM issue</a>. This means that you may see the following error when using <code>gu</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">“gu” cannot be opened because the developer cannot be verified</code></pre>
</div>
</div>
<div class="paragraph">
<p>Use the following command to recursively delete the <code>com.apple.quarantine</code> extended attribute on the GraalVM install directory as a workaround:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">xattr -r -d com.apple.quarantine ${GRAALVM_HOME}/../..</code></pre>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="solution"><a class="anchor" href="#solution"></a>Solution</h2>
<div class="sectionbody">
<div class="paragraph">
<p>We recommend that you follow the instructions in the next sections and package the application step by step. However, you can go right to the completed example.</p>
</div>
<div class="paragraph">
<p>Clone the Git repository: <code>git clone <a href="https://github.com/quarkusio/quarkus-quickstarts.git" class="bare">https://github.com/quarkusio/quarkus-quickstarts.git</a></code>, or download an <a href="https://github.com/quarkusio/quarkus-quickstarts/archive/master.zip">archive</a>.</p>
</div>
<div class="paragraph">
<p>The solution is located in the <code>getting-started</code> directory.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="producing-a-native-executable"><a class="anchor" href="#producing-a-native-executable"></a>Producing a native executable</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The native executable for our application will contain the application code, required libraries, Java APIs, and a reduced version of a VM. The smaller VM base improves the startup time of the application and produces a minimal disk footprint.</p>
</div>
<div class="paragraph">
<p><span class="image"><img src="/guides/images/native-executable-process.png" alt="Creating a native executable"></span></p>
</div>
<div class="paragraph">
<p>If you have generated the application from the previous tutorial, you can find in the <code>pom.xml</code> the following <em>profile</em>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;profiles&gt;
    &lt;profile&gt;
        &lt;id&gt;native&lt;/id&gt;
        &lt;properties&gt;
            &lt;quarkus.package.type&gt;native&lt;/quarkus.package.type&gt;
        &lt;/properties&gt;
    &lt;/profile&gt;
&lt;/profiles&gt;</code></pre>
</div>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>You can provide custom options for the <code>native-image</code> command using the <code>&lt;quarkus.native.additional-build-args&gt;</code> property.
Multiple options may be separated by a comma.</p>
</div>
<div class="paragraph">
<p>Another possibility is to include the <code>quarkus.native.additional-build-args</code> configuration property in your <code>application.properties</code>.</p>
</div>
<div class="paragraph">
<p>You can find more information about how to configure the native image building process in the <a href="#configuration-reference">Configuring the Native Executable</a> section below.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>We use a profile because, you will see very soon, packaging the native executable takes a <em>few</em> minutes. You could
just pass -Dquarkus.package.type=native as a property on the command line, however it is better to use a profile as
this allows native image tests to also be run.</p>
</div>
<div class="paragraph">
<p>Create a native executable using: <code>./mvnw package -Pnative</code>.</p>
</div>
<div id="graal-and-windows" class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="title">Issues with packaging on Windows</div>
<div class="paragraph">
<p>The Microsoft Native Tools for Visual Studio must first be initialized before packaging. You can do this by starting
the <code>x64 Native Tools Command Prompt</code> that was installed with the Visual Studio Build Tools. At
<code>x64 Native Tools Command Prompt</code> you can navigate to your project folder and run <code>mvnw package -Pnative</code>.</p>
</div>
<div class="paragraph">
<p>Another solution is to write a script to do this for you:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">cmd /c 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" &amp;&amp; mvn package -Pnative'</code></pre>
</div>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>In addition to the regular files, the build also produces <code>target/getting-started-1.0-SNAPSHOT-runner</code>.
You can run it using: <code>./target/getting-started-1.0-SNAPSHOT-runner</code>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="testing-the-native-executable"><a class="anchor" href="#testing-the-native-executable"></a>Testing the native executable</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Producing a native executable can lead to a few issues, and so it&#8217;s also a good idea to run some tests against the application running in the native file.</p>
</div>
<div class="paragraph">
<p>In the <code>pom.xml</code> file, the <code>native</code> profile contains:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;plugin&gt;
    &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
    &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
    &lt;version&gt;${surefire-plugin.version}&lt;/version&gt;
    &lt;executions&gt;
        &lt;execution&gt;
            &lt;goals&gt;
                &lt;goal&gt;integration-test&lt;/goal&gt;
                &lt;goal&gt;verify&lt;/goal&gt;
            &lt;/goals&gt;
            &lt;configuration&gt;
                &lt;systemPropertyVariables&gt;
                    &lt;native.image.path&gt;${project.build.directory}/${project.build.finalName}-runner&lt;/native.image.path&gt;
                    &lt;java.util.logging.manager&gt;org.jboss.logmanager.LogManager&lt;/java.util.logging.manager&gt;
                    &lt;maven.home&gt;${maven.home}&lt;/maven.home&gt;
                &lt;/systemPropertyVariables&gt;
            &lt;/configuration&gt;
        &lt;/execution&gt;
    &lt;/executions&gt;
&lt;/plugin&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>This instructs the failsafe-maven-plugin to run integration-test and indicates the location of the produced native executable.</p>
</div>
<div class="paragraph">
<p>Then, open the <code>src/test/java/org/acme/quickstart/NativeGreetingResourceIT.java</code>. It contains:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.quickstart;


import io.quarkus.test.junit.NativeImageTest;

@NativeImageTest <i class="conum" data-value="1"></i><b>(1)</b>
public class NativeGreetingResourceIT extends GreetingResourceTest { <i class="conum" data-value="2"></i><b>(2)</b>

    // Run the same tests

}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Use another test runner that starts the application from the native file before the tests.
The executable is retrieved using the <code>native.image.path</code> system property configured in the <em>Failsafe Maven Plugin</em>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>We extend our previous tests, but you can also implement your tests</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>To see the <code>NativeGreetingResourceIT</code> run against the native executable, use <code>./mvnw verify -Pnative</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">./mvnw verify -Pnative
...
[getting-started-1.0-SNAPSHOT-runner:18820]     universe:     587.26 ms
[getting-started-1.0-SNAPSHOT-runner:18820]      (parse):   2,247.59 ms
[getting-started-1.0-SNAPSHOT-runner:18820]     (inline):   1,985.70 ms
[getting-started-1.0-SNAPSHOT-runner:18820]    (compile):  14,922.77 ms
[getting-started-1.0-SNAPSHOT-runner:18820]      compile:  20,361.28 ms
[getting-started-1.0-SNAPSHOT-runner:18820]        image:   2,228.30 ms
[getting-started-1.0-SNAPSHOT-runner:18820]        write:     364.35 ms
[getting-started-1.0-SNAPSHOT-runner:18820]      [total]:  52,777.76 ms
[INFO]
[INFO] --- maven-failsafe-plugin:2.22.1:integration-test (default) @ getting-started ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.acme.quickstart.NativeGreetingResourceIT
Executing [/data/home/gsmet/git/quarkus-quickstarts/getting-started/target/getting-started-1.0-SNAPSHOT-runner, -Dquarkus.http.port=8081, -Dtest.url=http://localhost:8081, -Dquarkus.log.file.path=build/quarkus.log]
2019-04-15 11:33:20,348 INFO  [io.quarkus] (main) Quarkus 999-SNAPSHOT started in 0.002s. Listening on: http://[::]:8081
2019-04-15 11:33:20,348 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy]
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.387 s - in org.acme.quickstart.NativeGreetingResourceIT
...</code></pre>
</div>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>By default, Quarkus waits for 60 seconds for the native image to start before automatically failing the native tests. This
duration can be changed using the <code>quarkus.test.native-image-wait-time</code> system property. For example, to increase the duration
to 300 seconds, use: <code>./mvnw verify -Pnative -Dquarkus.test.native-image-wait-time=300</code>.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>By default, native tests runs using the <code>prod</code> profile.
This can be overridden using the <code>quarkus.test.native-image-profile</code> property.
For example, in your <code>application.properties</code> file, add: <code>quarkus.test.native-image-profile=test</code>.
Alternatively, you can run your tests with: <code>./mvnw verify -Pnative -Dquarkus.test.native-image-profile=test</code>.
However, don&#8217;t forget that when the native executable is built the <code>prod</code> profile is enabled.
So, the profile you enable this way must be compatible with the produced executable.</p>
</div>
<div class="sect2">
<h3 id="excluding-tests-when-running-as-a-native-executable"><a class="anchor" href="#excluding-tests-when-running-as-a-native-executable"></a>Excluding tests when running as a native executable</h3>
<div class="paragraph">
<p>When running tests this way, the only things that actually run natively are you application endpoints, which
you can only test via HTTP calls. Your test code does not actually run natively, so if you are testing code
that does not call your HTTP endpoints, it&#8217;s probably not a good idea to run them as part of native tests.</p>
</div>
<div class="paragraph">
<p>If you share your test class between JVM and native executions like we advise above, you can mark certain tests
with the <code>@DisabledOnNativeImage</code> annotation in order to only run them on the JVM.</p>
</div>
</div>
<div class="sect2">
<h3 id="testing-an-existing-native-executable"><a class="anchor" href="#testing-an-existing-native-executable"></a>Testing an existing native executable</h3>
<div class="paragraph">
<p>It is also possible to re-run the tests against a native executable that has already been built. To do this run
<code>./mvnw test-compile failsafe:integration-test</code>. This will discover the existing native image and run the tests against it using
failsafe.</p>
</div>
<div class="paragraph">
<p>If the process cannot find the native image for some reason, or you want to test a native image that is no longer in the
target directory you can specify the executable with the <code>-Dnative.image.path=</code> system property.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="container-runtime"><a class="anchor" href="#container-runtime"></a>Creating a Linux executable without GraalVM installed</h2>
<div class="sectionbody">
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<i class="fa icon-important" title="Important"></i>
</td>
<td class="content">
Before going further, be sure to have a working container runtime (Docker, podman) environment. If you use Docker
on Windows you should share your project&#8217;s drive at Docker Desktop file share settings and restart Docker Desktop.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Quite often one only needs to create a native Linux executable for their Quarkus application (for example in order to run in a containerized environment) and would like to avoid
the trouble of installing the proper GraalVM version in order to accomplish this task (for example, in CI environments it&#8217;s common practice
to install as little software as possible).</p>
</div>
<div class="paragraph">
<p>To this end, Quarkus provides a very convenient way of creating a native Linux executable by leveraging a container runtime such as Docker or podman.
The easiest way of accomplishing this task is to execute:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">./mvnw package -Pnative -Dquarkus.native.container-build=true</code></pre>
</div>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>You can also select the container runtime to use with:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs"># Docker
./mvnw package -Pnative -Dquarkus.native.container-runtime=docker
# Podman
./mvnw package -Pnative -Dquarkus.native.container-runtime=podman</code></pre>
</div>
</div>
<div class="paragraph">
<p>These are normal Quarkus config properties, so if you always want to build in a container
it is recommended you add these to your <code>application.properties</code> in order to avoid specifying them every time.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="creating-a-container"><a class="anchor" href="#creating-a-container"></a>Creating a container</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="using-the-container-image-extensions"><a class="anchor" href="#using-the-container-image-extensions"></a>Using the container-image extensions</h3>
<div class="paragraph">
<p>By far the easiest way to create a container-image from your Quarkus application is to leverage one of the container-image extensions.</p>
</div>
<div class="paragraph">
<p>If one of those extensions is present, then creating a container image for the native executable is essentially a matter of executing a single command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">./mvnw package -Pnative -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true</code></pre>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p><code>quarkus.native.container-build=true</code> allows for creating a Linux executable without GraalVM being installed (and is only necessary if you don&#8217;t have GraalVM installed locally or your local operating system is not Linux)</p>
</li>
<li>
<p><code>quarkus.container-image.build=true</code> instructs Quarkus to create a container-image using the final application artifact (which is the native executable in this case)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>See the <a href="container-image">Container Image guide</a> for more details.</p>
</div>
</div>
<div class="sect2">
<h3 id="manually"><a class="anchor" href="#manually"></a>Manually</h3>
<div class="paragraph">
<p>You can run the application in a container using the JAR produced by the Quarkus Maven Plugin.
However, in this section we focus on creating a container image using the produced native executable.</p>
</div>
<div class="paragraph">
<p><span class="image"><img src="/guides/images/containerization-process.png" alt="Containerization Process"></span></p>
</div>
<div class="paragraph">
<p>When using a local GraalVM installation, the native executable targets your local operating system (Linux, macOS, Windows etc).
However, as a container may not use the same <em>executable</em> format as the one produced by your operating system,
we will instruct the Maven build to produce an executable by leveraging a container runtime (as described in <a href="#container-runtime">this section</a>):</p>
</div>
<div class="paragraph">
<p>The produced executable will be a 64 bit Linux executable, so depending on your operating system it may no longer be runnable.
However, it&#8217;s not an issue as we are going to copy it to a container.
The project generation has provided a <code>Dockerfile.native</code> in the <code>src/main/docker</code> directory with the following content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="dockerfile" class="language-dockerfile hljs">FROM registry.access.redhat.com/ubi8/ubi-minimal
WORKDIR /work/
COPY target/*-runner /work/application
RUN chmod 775 /work
EXPOSE 8080
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="title">Ubi?</div>
<div class="paragraph">
<p>The provided <code>Dockerfiles</code> use <a href="https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/ubi8/ubi">UBI</a> (Universal Base Image) as parent image.
This base image has been tailored to work perfectly in containers.
The <code>Dockerfiles</code> use the <a href="https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/ubi-minimal"><em>minimal</em> version</a> of the base image to reduce the size of the produced image.</p>
</div>
<div class="paragraph">
<p>You can read more about UBI on:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/ubi8/ubi">the UBI image page</a></p>
</li>
<li>
<p><a href="https://access.redhat.com/containers/#/registry.access.redhat.com/ubi8/ubi-minimal">the <em>UBI-minimal</em> image page</a></p>
</li>
<li>
<p><a href="https://access.redhat.com/containers/?tab=tags#/registry.access.redhat.com/ubi8/ubi-minimal">the list of <em>UBI-minimal</em> tags</a></p>
</li>
</ul>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Then, if you didn&#8217;t delete the generated native executable, you can build the docker image with:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">docker build -f src/main/docker/Dockerfile.native -t quarkus-quickstart/getting-started .</code></pre>
</div>
</div>
<div class="paragraph">
<p>And finally, run it with:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">docker run -i --rm -p 8080:8080 quarkus-quickstart/getting-started</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you are interested in tiny Docker images, check the <a href="https://github.com/quarkusio/quarkus-images/tree/master/distroless">distroless</a> version.
</td>
</tr>
</table>
</div>
</div>
<div class="sect2">
<h3 id="using-a-multi-stage-docker-build"><a class="anchor" href="#using-a-multi-stage-docker-build"></a>Using a multi-stage Docker build</h3>
<div class="paragraph">
<p>The previous section showed you how to build a native executable using Maven, but implicitly required that the proper GraalVM version be installed on the building machine (be it your local machine or your CI/CD infrastructure).</p>
</div>
<div class="paragraph">
<p>In cases where the GraalVM requirement cannot be met, you can use Docker to perform the Maven build by using a multi-stage Docker build. A multi-stage Docker build is like two Dockerfile files combined in one, the first is used to build the artifact used by the second.</p>
</div>
<div class="paragraph">
<p>In this guide we will use the first stage to generate the native executable using Maven and the second stage to create our runtime image.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="dockerfile" class="language-dockerfile hljs">## Stage 1 : build with maven builder image with native capabilities
FROM quay.io/quarkus/centos-quarkus-maven:20.1.0-java11 AS build
COPY pom.xml /usr/src/app/
RUN mvn -f /usr/src/app/pom.xml -B de.qaware.maven:go-offline-maven-plugin:1.2.5:resolve-dependencies
COPY src /usr/src/app/src
USER root
RUN chown -R quarkus /usr/src/app
USER quarkus
RUN mvn -f /usr/src/app/pom.xml -Pnative clean package

## Stage 2 : create the docker final image
FROM registry.access.redhat.com/ubi8/ubi-minimal
WORKDIR /work/
COPY --from=build /usr/src/app/target/*-runner /work/application

# set up permissions for user `1001`
RUN chmod 775 /work /work/application \
  &amp;&amp; chown -R 1001 /work \
  &amp;&amp; chmod -R "g+rwX" /work \
  &amp;&amp; chown -R 1001:root /work

EXPOSE 8080
USER 1001

CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]</code></pre>
</div>
</div>
<div class="paragraph">
<p>Save this file in <code>src/main/docker/Dockerfile.multistage</code> as it is not included in the getting started quickstart.</p>
</div>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<i class="fa icon-warning" title="Warning"></i>
</td>
<td class="content">
<div class="paragraph">
<p>Before launching our Docker build, we need to update the default <code>.dockerignore</code> file as it filters everything except the <code>target</code> directory and as we plan to build inside a container we need to be able to copy the <code>src</code> directory. So edit your <code>.dockerignore</code> and remove or comment its content.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">docker build -f src/main/docker/Dockerfile.multistage -t quarkus-quickstart/getting-started .</code></pre>
</div>
</div>
<div class="paragraph">
<p>And finally, run it with:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">docker run -i --rm -p 8080:8080 quarkus-quickstart/getting-started</code></pre>
</div>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
<div class="paragraph">
<p>If you need SSL support in your native executable, you can easily include the necessary libraries in your Docker image.</p>
</div>
<div class="paragraph">
<p>Please see <a href="native-and-ssl#working-with-containers">our Using SSL With Native Executables guide</a> for more information.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuration-reference"><a class="anchor" href="#configuration-reference"></a>Configuring the Native Executable</h2>
<div class="sectionbody">
<div class="paragraph">
<p>There are a lot of different configuration options that can affect how the native executable is generated.
These are provided in <code>application.properties</code> the same as any other config property.</p>
</div>
<div class="paragraph">
<p>The properties are shown below:</p>
</div>
<div class="paragraph configuration-legend">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> Configuration property fixed at build time - All other configuration properties are overridable at runtime</p>
</div>
<table class="tableblock frame-all grid-all stretch configuration-reference">
<colgroup>
<col style="width: 80%;">
<col style="width: 10%;">
<col style="width: 10%;">
</colgroup>
<tbody>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock"><a id="quarkus-native-pkg-native-config_configuration"></a><a href="#quarkus-native-pkg-native-config_configuration">Configuration property</a></p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Type</p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Default</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.additional-build-args"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.additional-build-args">quarkus.native.additional-build-args</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Additional arguments to pass to the build process</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">list of string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.enable-http-url-handler"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.enable-http-url-handler">quarkus.native.enable-http-url-handler</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the HTTP url handler should be enabled, allowing you to do URL.openConnection() for HTTP URLs</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.enable-https-url-handler"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.enable-https-url-handler">quarkus.native.enable-https-url-handler</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the HTTPS url handler should be enabled, allowing you to do URL.openConnection() for HTTPS URLs</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.enable-all-security-services"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.enable-all-security-services">quarkus.native.enable-all-security-services</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If all security services should be added to the native image</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.add-all-charsets"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.add-all-charsets">quarkus.native.add-all-charsets</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If all character sets should be added to the native image. This increases image size</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.graalvm-home"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.graalvm-home">quarkus.native.graalvm-home</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The location of the Graal distribution</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>${GRAALVM_HOME:}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.java-home"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.java-home">quarkus.native.java-home</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The location of the JDK</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html">File</a></p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>${java.home}</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.native-image-xmx"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.native-image-xmx">quarkus.native.native-image-xmx</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The maximum Java heap to be used during the native image generation</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.debug-build-process"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.debug-build-process">quarkus.native.debug-build-process</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the native image build should wait for a debugger to be attached before running. This is an advanced option and is generally only intended for those familiar with GraalVM internals</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.publish-debug-build-process-port"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.publish-debug-build-process-port">quarkus.native.publish-debug-build-process-port</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the debug port should be published when building with docker and debug-build-process is true</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.cleanup-server"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.cleanup-server">quarkus.native.cleanup-server</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the native image server should be restarted</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.enable-isolates"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.enable-isolates">quarkus.native.enable-isolates</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If isolates should be enabled</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.enable-fallback-images"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.enable-fallback-images">quarkus.native.enable-fallback-images</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If a JVM based 'fallback image' should be created if native image fails. This is not recommended, as this is functionally the same as just running the application in a JVM</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.enable-server"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.enable-server">quarkus.native.enable-server</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the native image server should be used. This can speed up compilation but can result in changes not always being picked up due to cache invalidation not working 100%</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.auto-service-loader-registration"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.auto-service-loader-registration">quarkus.native.auto-service-loader-registration</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If all META-INF/services entries should be automatically registered</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.dump-proxies"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.dump-proxies">quarkus.native.dump-proxies</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the bytecode of all proxies should be dumped for inspection</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.container-build"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.container-build">quarkus.native.container-build</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If this build should be done using a container runtime. If this is set docker will be used by default, unless container-runtime is also set.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.builder-image"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.builder-image">quarkus.native.builder-image</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The docker image to use to do the image build</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>quay.io/quarkus/ubi-quarkus-native-image:20.1.0-java11</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.container-runtime"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.container-runtime">quarkus.native.container-runtime</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The container runtime (e.g. docker) that is used to do an image based build. If this is set then a container build is always done.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.container-runtime-options"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.container-runtime-options">quarkus.native.container-runtime-options</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Options to pass to the container runtime</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">list of string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.enable-vm-inspection"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.enable-vm-inspection">quarkus.native.enable-vm-inspection</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the resulting image should allow VM introspection</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.full-stack-traces"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.full-stack-traces">quarkus.native.full-stack-traces</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If full stack traces are enabled in the resulting image</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.enable-reports"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.enable-reports">quarkus.native.enable-reports</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If the reports on call paths and included packages/classes/methods should be generated</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.report-exception-stack-traces"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.report-exception-stack-traces">quarkus.native.report-exception-stack-traces</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If exceptions should be reported with a full stack trace</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.report-errors-at-runtime"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.report-errors-at-runtime">quarkus.native.report-errors-at-runtime</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If errors should be reported at runtime. This is a more relaxed setting, however it is not recommended as it means your application may fail at runtime if an unsupported feature is used by accident.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.resources.includes"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.resources.includes">quarkus.native.resources.includes</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>A comma separated list of globs to match resource paths that should be added to the native image.
 Use slash (<code>/</code>) as a path separator on all platforms. Globs must not start with slash.
 By default, no resources are included.
 Example: Given that you have <code>src/main/resources/ignored.png</code> and <code>src/main/resources/foo/selected.png</code> in your source tree and one of your dependency JARs contains <code>bar/some.txt</code> file, with the following configuration quarkus.native.resources.includes = foo/**,bar/**/*.txt  the files <code>src/main/resources/foo/selected.png</code> and <code>bar/some.txt</code> will be included in the native image, while <code>src/main/resources/ignored.png</code> will not be included.
 Supported glob features   Feature Description   <code>*</code> Matches a (possibly empty) sequence of characters that does not contain slash (<code>/</code>)   <code>**</code> Matches a (possibly empty) sequence of characters that may contain slash (<code>/</code>)   <code>?</code> Matches one character, but not slash   <code>[abc]</code> Matches one character given in the bracket, but not slash   <code>[a-z]</code> Matches one character from the range given in the bracket, but not slash   <code>[!abc]</code> Matches one character not named in the bracket; does not match slash   <code>[a-z]</code> Matches one character outside the range given in the bracket; does not match slash   <code>{one,two,three}</code> Matches any of the alternating tokens separated by comma; the tokens may contain wildcards, nested alternations and ranges   <code>\</code> The escape character
 Note that there are three levels of escaping when passing this option via <code>application.properties</code>:
 . <code>application.properties</code> parser
 - MicroProfile Config list converter that splits the comma separated list
 - Glob parser  All three levels use backslash (<code>\</code>) as the escaping character. So you need to use an appropriate number of backslashes depending on which level you want to escape.
 Note that Quarkus extensions typically include the resources they require by themselves. This option is useful in situations when the built-in functionality is not sufficient.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">list of string</p></td>
<td class="tableblock halign-left valign-middle"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-native-pkg-native-config_quarkus.native.debug.enabled"></a><code><a href="#quarkus-native-pkg-native-config_quarkus.native.debug.enabled">quarkus.native.debug.enabled</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If debug is enabled and debug symbols are generated. The symbols will be generated in a separate .debug file.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="sect1">
<h2 id="whats-next"><a class="anchor" href="#whats-next"></a>What&#8217;s next?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This guide covered the creation of a native (binary) executable for your application.
It provides an application exhibiting a swift startup time and consuming less memory.
However, there is much more.</p>
</div>
<div class="paragraph">
<p>We recommend continuing the journey with the <a href="deploying-to-kubernetes">deployment to Kubernetes and OpenShift</a>.</p>
</div>
</div>
</div>
    </div>
  </div>
</div>

  </div>

  <div class="content project-footer">
  <div class="footer-section">
    <div class="logo-wrapper">
      <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_reverse.svg" class="project-logo" title="Quarkus"></a>
    </div>
  </div>
  <div class="grid-wrapper">
    <p class="grid__item width-3-12">Quarkus is open. All dependencies of this project are available under the <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a> or compatible license.<br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a>, is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/quarkusio/quarkusio.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p>

    
      <div class="width-1-12 project-links">
        <span>Navigation</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="/">Home</a></li>
          
            <li><a href="/guides">Guides</a></li>
          
            <li><a href="/community/#contributing">Contribute</a></li>
          
            <li><a href="/faq">FAQ</a></li>
          
            <li><a href="/get-started">Get Started</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Contribute</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://twitter.com/quarkusio">Follow us</a></li>
          
            <li><a href="https://github.com/quarkusio">GitHub</a></li>
          
            <li><a href="/security">Security&nbsp;policy</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Get Help</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://groups.google.com/forum/#!forum/quarkus-dev">Forums</a></li>
          
            <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li>
          
        </ul>
      </div>
    

    
      <div class="width-3-12 more-links">
        <span>Quarkus is made of community projects</span>
        <ul class="footer-links">
          
            <li><a href="https://vertx.io/" target="_blank">Eclipse Vert.x</a></li>
          
            <li><a href="https://microprofile.io" target="_blank">Eclipse MicroProfile</a></li>
          
            <li><a href="https://hibernate.org" target="_blank">Hibernate</a></li>
          
            <li><a href="https://netty.io" target="_blank">Netty</a></li>
          
            <li><a href="https://resteasy.github.io" target="_blank">RESTEasy</a></li>
          
            <li><a href="https://camel.apache.org" target="_blank">Apache Camel</a></li>
          
            <li><a href="https://code.quarkus.io/" target="_blank">And many more...</a></li>
          
        </ul>
      </div>
    
  </div>
</div>
  <div class="content redhat-footer">
  <div class="grid-wrapper">
    <span class="licence">
      <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> | <a href="https://www.redhat.com/en/about/privacy-policy">Privacy Policy</a>
    </span>
    <span class="redhat">
      Sponsored by
    </span>
    <span class="redhat-logo">
      <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a>
    </span>
  </div>
</div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script>
  <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script>
  <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script>
  <script src="/assets/javascript/satellite.js" type="text/javascript"></script>
  <script src="https://quarkus.io/guides/javascript/config.js" type="text/javascript"></script>
  <script src="/assets/javascript/search-filter.js" type="text/javascript"></script>
  <script src="/assets/javascript/back-to-top.js" type="text/javascript"></script>
</body>

</html>
